import React from 'react';
import { AxButton, AxDescriptions, AxItem } from '@/components/AxBase';
import { router } from 'umi';
import { axhelper } from '@/shared/axhelper';
import { axurl } from '@/shared/axurl';
import { Transfer } from '@/pages/buyer/person/flow/create/lib/transfer';
import { EduStatus } from '@/pages/buyer/person/flow/create/lib/eduStatus';
import { NameIdcard } from '@/pages/buyer/person/flow/create/lib/nameIdcard';

export const flowTypes = [{
    type: 1,
    title: '发起转专业流程',
    dealTitle: '处理转专业流程',
    viewTitle: '查看转专业流程',
    tabs: ['tab4'],
    FlowComponent: Transfer,
    // url: axurl.college.s.instructor.instructorCommon.StudentList.flow,
    /** 成功信息 */
    Content: ({ result }: any) => (
        <AxDescriptions title={flowTypes[0].title}>
            <AxItem label="就读方案" >{result.schemeName}</AxItem>
            <AxItem label="校区">{result.campusName}</AxItem>
            <AxItem label="就读专业">{result.majorName}</AxItem>
            <AxItem label="特征">{result.featureName}</AxItem>
            <AxItem label="缴费方案" span={2}>{result.planName}</AxItem>
            <AxItem label="标题" span={3}>{result.title}</AxItem>
            <AxItem label="内容" span={3}>{result.description}</AxItem>
            <AxItem label="接收人" span={3}>{result.userName}</AxItem>
        </AxDescriptions>
    ),
    /** 成功页面额外的操作信息 */
    Extra: () => (
        <>
            <AxButton className="ax-no-class ax-btn-color3" icon="unordered-list" onClick={() => router.goBack()} >返回列表</AxButton>
        </>
    ),
}, {
    type: 3,
    title: '发起修改在校流程',
    dealTitle: '处理修改在校流程',
    viewTitle: '查看修改在校流程',
    tabs: ['tab4'],
    FlowComponent: EduStatus,
    // url: axurl.college.s.instructor.instructorCommon.StudentList.flow.eduStatus,
    /** 成功信息 */
    Content: ({ result }: any) => (
        <AxDescriptions title={flowTypes[1].title}>
            <AxItem label="姓名" >{result.name}</AxItem>
            <AxItem label="身份证">{result.idcard}</AxItem>
            <AxItem label="在校状态">{axhelper.getTextByValue(result.eduStatus, axhelper.getDicByEnumName('eduStatus'))}</AxItem>
            <AxItem label="标题" span={3}>{result.title}</AxItem>
            <AxItem label="内容" span={3}>{result.description}</AxItem>
            <AxItem label="接收人" span={3}>{result.userName}</AxItem>
        </AxDescriptions>
    ),
    /** 成功页面额外的操作信息 */
    Extra: () => (
        <>
            <AxButton className="ax-no-class ax-btn-color3" icon="unordered-list" onClick={() => router.goBack()} >返回列表</AxButton>
        </>
    ),
}, {
    type: 4,
    title: '发起修改姓名身份证流程',
    dealTitle: '处理修改姓名身份证流程',
    viewTitle: '查看修改姓名身份证流程',
    tabs: ['tab4'],
    FlowComponent: NameIdcard,
    url: axurl.center.s.flow.nameAndIdcard,
    /** 成功信息 */
    Content: ({ result }: any) => (
        <AxDescriptions title={flowTypes[2].title}>
            <AxItem label="姓名" >{result.newName}</AxItem>
            <AxItem label="身份证" span={2}>{result.newIdCard}</AxItem>
            <AxItem label="标题" span={3}>{result.title}</AxItem>
            <AxItem label="内容" span={3}>{result.description}</AxItem>
            <AxItem label="接收人" span={3}>{result.userName}</AxItem>
        </AxDescriptions>
    ),
    /** 成功页面额外的操作信息 */
    Extra: () => (
        <>
            <AxButton className="ax-no-class ax-btn-color3" icon="unordered-list" onClick={() => router.goBack()} >返回列表</AxButton>
        </>
    ),
}]